import type { IColumnsOption } from 'vc';
import { CellRenderMap, INDEX, COMPANY_NAME, BUSINESS_DATA, REGISTERED_CAPITAL, PROVINCE, CITY, COUNTRY, INDUSTRY_CATEGORY } from '@/utils/tableColumn';

export function useTable() {
  const columns = ref<IColumnsOption[]>([
    { ...INDEX },
    { ...COMPANY_NAME },
    {
      field: 'dischargePermitNumber',
      title: '排污许可证编号',
      width: 230,
      align: 'center',
      sortable: true,
      sortBy: 'dischargePermitNumber',
      cellRender: {
        name: CellRenderMap.HighLight
      }
    },
    {
      title: '撤销日期',
      field: 'revocationDate',
      width: 110,
      align: 'center',
      sortable: true,
      sortBy: 'date'
    },
    {
      field: 'revocationReason',
      title: '撤销类型',
      minWidth: 230
    },
    { ...PROVINCE },
    { ...CITY },
    { ...COUNTRY },
    { ...INDUSTRY_CATEGORY },
    { ...BUSINESS_DATA },
    { ...REGISTERED_CAPITAL }
  ]);

  return {
    columns
  };
}
